package
{
	import org.flixel.*;
	public class NPC extends FlxSprite
	{

		public var message:String;
		public var type:String;

		
		public var exiting:Boolean;
		public var direction:String;
		
		public function NPC(startX:int, startY:int, type:String, theMessage:String, theDirection:String)
		{
			if (theDirection == "") {
				direction = "";
			} else {
				direction = theDirection;
			}
			message = theMessage;
			var theImage:Class;
			if (type == "farmer") {
				theImage = Res.Farmer;
			} else if (type == "child") {
				theImage = Res.Child;
			} else if (type == "villageLeader") {
				theImage = Res.VillageLeader;
			} else if (type == "magnifico") {
				theImage = Res.Magnifico;
			} else if (type == "maskedPoof") {
				theImage = Res.MaskedPoof;
			} else if (type == "oldWastePoofFemale") {
				theImage = Res.OldWastePoofFemale;
			} else if (type == "oldWastePoofMale") {
				theImage = Res.OldWastePoofMale;
			} else  if (type == "poofFemale") {
				theImage = Res.PoofFemale;
			} else  if (type == "voiceOnTheWind") {
				theImage = Res.VoiceOnTheWind;
			} else  if (type == "resistanceLeader") {
				theImage = Res.ResistanceLeader;
			} else  if (type == "boss") {
				theImage = Res.Boss;
			} else {
				theImage = Res.PoofMale;
			}
			super(startX,startY,theImage);
		}
		
		public function exit():void {
			if (direction == "UP") {
				velocity.y = -80;
			} else if (direction == "DOWN") {
				velocity.y = 80;
			} else if (direction == "RIGHT") {
				velocity.x = 80;
			} else {
				velocity.x = -80;
			}
		}
	}
}